package display2012;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

public class DisplayTCPServer extends Thread {
	
	final int port = 4444;
	
	ServerSocket serverSocket;
	boolean stop;
		
	public DisplayTCPServer() throws IOException{
		this.serverSocket = new ServerSocket(port);
		this.stop = false;
	}
	
	@Override
	public void run()
	{
		while(!stop)
		{
			Socket clientSocket = null;
			try {
			    clientSocket = serverSocket.accept();
			    /*
			     * Bisogna implementare qualcosa del tipo
			     * IContaKM addListener(new RemoteProcess(clientSocket));
			     */
			} 
			catch (IOException e) {
			    System.out.println("Accept failed: 4444");
			    System.exit(-1);
			}
		}
	}

}
